package com.lytfly.flowable.modules.flow.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.io.Serializable;
import java.time.LocalDateTime;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * <p>
 *
 * </p>
 *
 * @author liuyuantao
 * @since 2021年07月15日 13时40分
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("flow_comment_info")
public class FlowCommentInfo extends Model<FlowCommentInfo> {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_UUID)
    private String id;

    /**
     * 类型
     */
    @TableField("`type`")
    private String type;

    /**
     * 员工工号
     */
    @TableField("personal_code")
    private String personalCode;

    /**
     * 审批时间
     */
    @TableField("`time`")
    private LocalDateTime time;

    /**
     * 任务id
     */
    @TableField("task_id")
    private String taskId;

    @TableField("activity_id")
    private String activityId;

    @TableField("activity_name")
    private String activityName;

    /**
     * 流程实例id
     */
    @TableField("process_instance_id")
    private String processInstanceId;

    /**
     * 动作
     */
    @TableField("`action`")
    private String action;

    /**
     * 审批意见
     */
    private String message;

    @TableField(exist = false)
    protected String typeName;

    public FlowCommentInfo(String type, String personalCode, String processInstanceId, String message) {
        this.type = type;
        this.personalCode = personalCode;
        this.processInstanceId = processInstanceId;
        this.message = message;
    }

    public FlowCommentInfo(String type, String personalCode, String taskId, String processInstanceId, String message) {
        this.type = type;
        this.personalCode = personalCode;
        this.taskId = taskId;
        this.processInstanceId = processInstanceId;
        this.message = message;
    }


    @Override
    public Serializable pkVal() {
        return this.id;
    }

}
